<?php
/**
 * [WeEngine System] Copyright (c) 2013 WE7.CC
 * $sn$
 * account 所有操作在GW界面进行
 */
defined('IN_IA') or exit('Access Denied');
load()->model('module');

$eid = intval($_GPC['eid']);
if(!empty($eid)) {
	$entry = module_entry($eid);
} else {
	$entry = array(
		'module' => $_GPC['m'],
		'do' => $_GPC['do'],
		'state' => $_GPC['state'],
		'direct' => 0
	);
}
$moduels = uni_modules();
if (empty($moduels[$entry['module']])) {
	message('您访问的功能模块不存在，请重新进入');
}
if(empty($entry) || empty($entry['do'])) {
	message('非法访问.');
}
$_GPC['__entry'] = $entry['title'];
$_GPC['__state'] = $entry['state'];
$_GPC['state'] = $entry['state'];
$_GPC['m'] = $entry['module'];
$_GPC['do'] = $entry['do'];

define('IN_MODULE', $entry['module']);
$_W['current_module'] = $moduels[$entry['module']];
$site = WeUtility::createModuleSite($entry['module']);
if(!is_error($site)) {
	$method = 'doMobile' . ucfirst($entry['do']);
	exit($site->$method());
}
exit();